package com.example.service.impl;

import com.example.entity.Diary;
import com.example.mapper.DiaryMapper;
import com.example.service.DiaryService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author cyk
 * @since 2022-04-30
 */
@Service
public class DiaryServiceImpl extends ServiceImpl<DiaryMapper, Diary> implements DiaryService {

    @Autowired
    DiaryMapper diaryMapper;

    @Override
    public List<Diary> diaryAll(Long stuId) {
        return diaryMapper.diaryAll(stuId);
    }

    @Override
    public Diary diaryById(Long id) {
        return diaryMapper.diaryById(id);
    }

    @Override
    public int saveDiary(Diary diary) {
        return diaryMapper.saveDiary(diary);
    }

    @Override
    public int updateDiary(Diary diary) {
        return diaryMapper.updateDiary(diary);
    }

    @Override
    public int delDiary(Long id) {
        return diaryMapper.delDiary(id);
    }
}
